package com.woniu.microchargeserver.chargemag.other.property.service.impl;

import com.woniu.microchargeserver.chargemag.other.projectserver.service.IProjectService;
import com.woniu.microchargeserver.chargemag.other.property.service.IPropertyService;
import com.woniu.microchargeserver.common.mapper.PropertyMapper;
import com.woniu.microcommonsserver.entity.OwnerInfoEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author: hejie
 * @date: 2021/2/2 5:59
 * @description:
 */
@Service
@Transactional(readOnly = true)
public class PropertyServiceImpl implements IPropertyService{

    @Resource
    private PropertyMapper propertyMapper;

    /**
     * 根据 房间id，查询它的业主
     * @param sid 房间id
     * @return
     */
   @Override
   public OwnerInfoEntity findOwerBySid(Long sid){
       return propertyMapper.findOwerBySid(sid);
   }

    /**
     * 根据 业主id，查询业主名字
     * @param id
     * @return
     */
   @Override
   public String findOwerNameById(Long id){
        return propertyMapper.findOwerNameById(id);
    }

    /**
     * 根据 房间id，查询它的业主id
     * @param sid
     * @return
     */
   @Override
   public Long findOwerIdBySid(Long sid){
       return propertyMapper.findOwerIdBySid(sid);
    }
}
